#region "Creator"

/*
 * ####     Developer Name : Wang Yucai
 * 
 * ####     Development Tool : Microsoft VisualStudio 2010 Ultimate Edition
 * 
 * ####     Create Time : 2014-07-08 15:25:56
 * 
 * ####     Namespace : Masterduner.SourceStudio.Practices.DevelopmentLibrary
 * 
 * ####     Type Name : Creator
 * 
 * ####     Full Name : Masterduner.SourceStudio.Practices.DevelopmentLibrary.Creator
 * 
 * ####     Machine Name : GLCHQWYCWINW7
 * 
 * ####     UserName : GUOCOLAND/wangyucai
 * 
 * ####     CLR Version : 4.0.30319.18444
 * 
 * ####     Target Framework Version : 4.0
 */

#endregion

using System;

namespace Masterduner.SourceStudio.Practices.DevelopmentLibrary
{
    /// <summary>
    /// <para>Masterduner.SourceStudio.Practices.DevelopmentLibrary.Creator</para>
    /// <para>
    /// 提供了动态创建对象实例的方法。
    /// </para>
    /// </summary>
    /// <remarks>
    /// <para>Target Framework Version : 4.0</para>
    /// </remarks>
    public static class Creator
    {
        #region CreateInstance
        /// <summary>
        /// 创建类型为<paramref name="type"/>的对象实例。
        /// </summary>
        /// <param name="type"><see cref="Type"/>对象实例。</param>
        /// <param name="arguments">调用<paramref name="type"/>类型的构造函数所需的参数。</param>
        /// <returns><see cref="Object"/>对象实例。</returns>
        static public object CreateInstance(Type type, params object[] arguments)
        {
            try
            {
                return Activator.CreateInstance(type, arguments);
            }
            catch (Exception ex)
            {
                throw new ArgumentsExceptionWrapper(ex);
            }
        }
        #endregion
    }
}

#region README

/*
 * ####     ©2014 Wang Yucai
 * 
 * ####     Contact me
 *                  
 *                  E-mail : Masterduner@Yeah.net
 *                  Mobile : 13621384677
 *                  QQ : 180261899
 */

#endregion